import numpy
a1 = numpy.array([[1,2,3],[2,3,4]])
a2 = numpy.array([[1,2,3],[2,3,4]])

b = numpy.random.randint(1,50,(3,4,5))#3个矩阵，每个4行5列
print(b)

c = numpy.diag([1,2,3,4])#对角阵
print(c)

print(numpy.allclose(a1,a2))#判断两个矩阵是否足够接近

a3 = numpy.insert(a1,2,[1,2,3],axis=0)#axis=0表示按行插入
print(a3)

#数组与矩阵相乘（对应元素相乘）
d1 = numpy.array([1,2,3])
d2 = numpy.array([[1,2,3],[2,3,4],[3,4,5]])
print(d1*d2)

#转置
print(d1.T)
